From 85dea78ecbf5bda88b577c154b53061a2d5afca2 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Sat, 12 Jan 2008 17:51:21 +0000 Subject: [PATCH] * importing livehack for profiling errors output * fixing some of CPU profile elimination errors :) --- includes/ProfilerSimple.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/ProfilerSimple.php b/includes/ProfilerSimple.php index d41e0a1885..07cc149621 100644 --- a/includes/ProfilerSimple.php +++ b/includes/ProfilerSimple.php @@ -49,7 +49,7 @@ class ProfilerSimple extends Profiler { if ($wgDebugFunctionEntry) { $this->debug(str_repeat(' ', count($this->mWorkStack)).'Entering '.$functionname."\n"); } - $this->mWorkStack[] = array($functionname, count( $this->mWorkStack)); + $this->mWorkStack[] = array($functionname, count( $this->mWorkStack),microtime(true)); } function profileOut($functionname) { @@ -59,7 +59,7 @@ class ProfilerSimple extends Profiler { $this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n"); } - list($ofname, /* $ocount */ ,$ortime,$octime) = array_pop($this->mWorkStack); + list($ofname, /* $ocount */ ,$ortime) = array_pop($this->mWorkStack); if (!$ofname) { $this->debug("Profiling error: $functionname\n"); @@ -68,10 +68,14 @@ class ProfilerSimple extends Profiler { $message = "Profile section ended by close(): {$ofname}"; $functionname = $ofname; $this->debug( "$message\n" ); + $this->mCollated[$message] = array( + 'real' => 0.0, 'count' => 1); } elseif ($ofname != $functionname) { $message = "Profiling error: in({$ofname}), out($functionname)"; $this->debug( "$message\n" ); + $this->mCollated[$message] = array( + 'real' => 0.0, 'count' => 1); } $entry =& $this->mCollated[$functionname]; $elapsedreal = microtime(true) - $ortime; -- 2.20.1